package com.cast.dao;


import com.cast.domain.User;
import org.apache.ibatis.annotations.*;

import java.util.List;

public interface UserDao {

    @Insert("insert into account (name,money) values (#{name},#{money})")
    void addUser(@Param("name") String name, @Param("money") double money);

    @Delete("delete from account where name = #{name}")
    void deleteByName(String name);


    @Delete("delete from account where id = #{id}")
    void deleteById(int id);

    @Update("update account set name = #{name},money = #{money} where id = #{id}")
    void updateUser(User user);

    @Select("select * from account")
    List<User> findAall();


    @Select("select * from account where name = #{name}")
    User findByName(String name);


    @Select("select * from account where id = #{id}")
    User findById(int id);
}
